
import { post } from './request'

export default (params)=> {
    post('/user/login', params)
    .then((res)=>{
        const { token, userInfo } = res || {};
        if(token && userInfo){
            localStorage.setItem('login_token',token);
            localStorage.setItem('user_info', JSON.stringify(userInfo));
            return true;
        }
        return false;
    })
}